package net.gdface.sdk.thrift.client;

import com.facebook.swift.codec.*;
import com.facebook.swift.codec.ThriftField.Requiredness;
import com.facebook.swift.service.*;
import com.google.common.util.concurrent.ListenableFuture;
import java.io.*;
import java.util.*;

@ThriftService("FaceApi")
public interface FaceApi
{
    @ThriftService("FaceApi")
    public interface Async
    {
        @ThriftMethod(value = "compare2Face",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture<Double> compare2Face(
            @ThriftField(value=1, name="imgData1", requiredness=Requiredness.OPTIONAL) final byte [] imgData1,
            @ThriftField(value=2, name="facePos1", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos1,
            @ThriftField(value=3, name="imgData2", requiredness=Requiredness.OPTIONAL) final byte [] imgData2,
            @ThriftField(value=4, name="facePos2", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos2
        );

        @ThriftMethod(value = "compareCode",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<Double> compareCode(
            @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
            @ThriftField(value=2, name="code2", requiredness=Requiredness.OPTIONAL) final byte [] code2
        );

        @ThriftMethod(value = "compareCodes",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<List<Double>> compareCodes(
            @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
            @ThriftField(value=2, name="codes", requiredness=Requiredness.OPTIONAL) final List<CodeInfo> codes
        );

        @ThriftMethod(value = "compareFaces",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture<CompareResult> compareFaces(
            @ThriftField(value=1, name="code", requiredness=Requiredness.OPTIONAL) final byte [] code,
            @ThriftField(value=2, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=3, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum
        );

        @ThriftMethod(value = "compareFeatures",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<List<Double>> compareFeatures(
            @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
            @ThriftField(value=2, name="codes", requiredness=Requiredness.OPTIONAL) final List<byte []> codes
        );

        @ThriftMethod(value = "detectAndCompare2Face",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture<Double> detectAndCompare2Face(
            @ThriftField(value=1, name="imgData1", requiredness=Requiredness.OPTIONAL) final byte [] imgData1,
            @ThriftField(value=2, name="detectRect1", requiredness=Requiredness.OPTIONAL) final FRect detectRect1,
            @ThriftField(value=3, name="imgData2", requiredness=Requiredness.OPTIONAL) final byte [] imgData2,
            @ThriftField(value=4, name="detectRect2", requiredness=Requiredness.OPTIONAL) final FRect detectRect2
        );

        @ThriftMethod(value = "detectAndGetCodeInfo",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture<List<CodeInfo>> detectAndGetCodeInfo(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum
        );

        @ThriftMethod(value = "detectCenterFace",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture<CodeInfo> detectCenterFace(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
        );

        @ThriftMethod(value = "detectFace",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture<List<CodeInfo>> detectFace(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
        );

        @ThriftMethod(value = "detectMaxFace",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture<CodeInfo> detectMaxFace(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
        );

        @ThriftMethod(value = "getCodeInfo",
                      exception = {
                          @ThriftException(type=NotFaceDetectedException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture<List<CodeInfo>> getCodeInfo(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum,
            @ThriftField(value=3, name="facePos", requiredness=Requiredness.OPTIONAL) final List<CodeInfo> facePos
        );

        @ThriftMethod(value = "getCodeInfoSingle",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<CodeInfo> getCodeInfoSingle(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="facePos", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos
        );

        @ThriftMethod(value = "getFeature",
                      exception = {
                          @ThriftException(type=NotFaceDetectedException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture<byte []> getFeature(
            @ThriftField(value=1, name="faces", requiredness=Requiredness.OPTIONAL) final Map<byte [], CodeInfo> faces
        );

        @ThriftMethod(value = "hasFace",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture<Boolean> hasFace(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
        );

        @ThriftMethod(value = "isLocal",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<Boolean> isLocal();

        @ThriftMethod(value = "matDetectAndGetCodeInfo",
                      exception = {
                          @ThriftException(type=NotFaceDetectedException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture<List<CodeInfo>> matDetectAndGetCodeInfo(
            @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
            @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
            @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
            @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
            @ThriftField(value=5, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum
        );

        @ThriftMethod(value = "matDetectFace",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<List<CodeInfo>> matDetectFace(
            @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
            @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
            @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
            @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height
        );

        @ThriftMethod(value = "matDetectMaxFace",
                      exception = {
                          @ThriftException(type=NotFaceDetectedException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture<CodeInfo> matDetectMaxFace(
            @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
            @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
            @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
            @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height
        );

        @ThriftMethod(value = "matGetCodeInfo",
                      exception = {
                          @ThriftException(type=NotFaceDetectedException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture<List<CodeInfo>> matGetCodeInfo(
            @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
            @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
            @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
            @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
            @ThriftField(value=5, name="facenum", requiredness=Requiredness.REQUIRED) final int facenum,
            @ThriftField(value=6, name="facePos", requiredness=Requiredness.OPTIONAL) final List<CodeInfo> facePos
        );

        @ThriftMethod(value = "matGetCodeInfoSingle",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<CodeInfo> matGetCodeInfoSingle(
            @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
            @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
            @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
            @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
            @ThriftField(value=5, name="facePos", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos
        );

        @ThriftMethod(value = "matHasFace",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<Boolean> matHasFace(
            @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
            @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
            @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
            @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height
        );

        @ThriftMethod(value = "matSearchFaces",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture<List<FseResult>> matSearchFaces(
            @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
            @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
            @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
            @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
            @ThriftField(value=5, name="facePos", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos,
            @ThriftField(value=6, name="similarty", requiredness=Requiredness.REQUIRED) final double similarty,
            @ThriftField(value=7, name="rows", requiredness=Requiredness.REQUIRED) final int rows
        );

        @ThriftMethod(value = "matWearMask",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<Boolean> matWearMask(
            @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
            @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
            @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
            @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
            @ThriftField(value=5, name="faceInfo", requiredness=Requiredness.OPTIONAL) final CodeInfo faceInfo
        );

        @ThriftMethod(value = "sdkCapacity",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<Map<String, String>> sdkCapacity();

        @ThriftMethod(value = "searchFaces",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=NotFaceDetectedException.class, id=2),
                          @ThriftException(type=ServiceRuntimeException.class, id=3)
                      })
        ListenableFuture<List<FseResult>> searchFaces(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="facePos", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos,
            @ThriftField(value=3, name="similarty", requiredness=Requiredness.REQUIRED) final double similarty,
            @ThriftField(value=4, name="rows", requiredness=Requiredness.REQUIRED) final int rows
        );

        @ThriftMethod(value = "searchFeatures",
                      exception = {
                          @ThriftException(type=ServiceRuntimeException.class, id=1)
                      })
        ListenableFuture<List<FseResult>> searchFeatures(
            @ThriftField(value=1, name="feature", requiredness=Requiredness.OPTIONAL) final byte [] feature,
            @ThriftField(value=2, name="similarty", requiredness=Requiredness.REQUIRED) final double similarty,
            @ThriftField(value=3, name="rows", requiredness=Requiredness.REQUIRED) final int rows
        );

        @ThriftMethod(value = "wearMask",
                      exception = {
                          @ThriftException(type=ImageErrorException.class, id=1),
                          @ThriftException(type=ServiceRuntimeException.class, id=2)
                      })
        ListenableFuture<Boolean> wearMask(
            @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
            @ThriftField(value=2, name="faceInfo", requiredness=Requiredness.OPTIONAL) final CodeInfo faceInfo
        );
    }
    @ThriftMethod(value = "compare2Face",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    double compare2Face(
        @ThriftField(value=1, name="imgData1", requiredness=Requiredness.OPTIONAL) final byte [] imgData1,
        @ThriftField(value=2, name="facePos1", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos1,
        @ThriftField(value=3, name="imgData2", requiredness=Requiredness.OPTIONAL) final byte [] imgData2,
        @ThriftField(value=4, name="facePos2", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos2
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "compareCode",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    double compareCode(
        @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
        @ThriftField(value=2, name="code2", requiredness=Requiredness.OPTIONAL) final byte [] code2
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "compareCodes",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    List<Double> compareCodes(
        @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
        @ThriftField(value=2, name="codes", requiredness=Requiredness.OPTIONAL) final List<CodeInfo> codes
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "compareFaces",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    CompareResult compareFaces(
        @ThriftField(value=1, name="code", requiredness=Requiredness.OPTIONAL) final byte [] code,
        @ThriftField(value=2, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=3, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "compareFeatures",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    List<Double> compareFeatures(
        @ThriftField(value=1, name="code1", requiredness=Requiredness.OPTIONAL) final byte [] code1,
        @ThriftField(value=2, name="codes", requiredness=Requiredness.OPTIONAL) final List<byte []> codes
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "detectAndCompare2Face",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    double detectAndCompare2Face(
        @ThriftField(value=1, name="imgData1", requiredness=Requiredness.OPTIONAL) final byte [] imgData1,
        @ThriftField(value=2, name="detectRect1", requiredness=Requiredness.OPTIONAL) final FRect detectRect1,
        @ThriftField(value=3, name="imgData2", requiredness=Requiredness.OPTIONAL) final byte [] imgData2,
        @ThriftField(value=4, name="detectRect2", requiredness=Requiredness.OPTIONAL) final FRect detectRect2
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "detectAndGetCodeInfo",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    List<CodeInfo> detectAndGetCodeInfo(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "detectCenterFace",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    CodeInfo detectCenterFace(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "detectFace",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    List<CodeInfo> detectFace(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
    ) throws ImageErrorException, ServiceRuntimeException;

    @ThriftMethod(value = "detectMaxFace",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    CodeInfo detectMaxFace(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "getCodeInfo",
                  exception = {
                      @ThriftException(type=NotFaceDetectedException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    List<CodeInfo> getCodeInfo(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum,
        @ThriftField(value=3, name="facePos", requiredness=Requiredness.OPTIONAL) final List<CodeInfo> facePos
    ) throws NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "getCodeInfoSingle",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    CodeInfo getCodeInfoSingle(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="facePos", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "getFeature",
                  exception = {
                      @ThriftException(type=NotFaceDetectedException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    byte [] getFeature(
        @ThriftField(value=1, name="faces", requiredness=Requiredness.OPTIONAL) final Map<byte [], CodeInfo> faces
    ) throws NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "hasFace",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    boolean hasFace(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData
    ) throws ImageErrorException, ServiceRuntimeException;

    @ThriftMethod(value = "isLocal",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    boolean isLocal() throws ServiceRuntimeException;

    @ThriftMethod(value = "matDetectAndGetCodeInfo",
                  exception = {
                      @ThriftException(type=NotFaceDetectedException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    List<CodeInfo> matDetectAndGetCodeInfo(
        @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
        @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
        @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
        @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
        @ThriftField(value=5, name="faceNum", requiredness=Requiredness.REQUIRED) final int faceNum
    ) throws NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "matDetectFace",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    List<CodeInfo> matDetectFace(
        @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
        @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
        @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
        @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "matDetectMaxFace",
                  exception = {
                      @ThriftException(type=NotFaceDetectedException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    CodeInfo matDetectMaxFace(
        @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
        @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
        @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
        @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height
    ) throws NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "matGetCodeInfo",
                  exception = {
                      @ThriftException(type=NotFaceDetectedException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    List<CodeInfo> matGetCodeInfo(
        @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
        @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
        @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
        @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
        @ThriftField(value=5, name="facenum", requiredness=Requiredness.REQUIRED) final int facenum,
        @ThriftField(value=6, name="facePos", requiredness=Requiredness.OPTIONAL) final List<CodeInfo> facePos
    ) throws NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "matGetCodeInfoSingle",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    CodeInfo matGetCodeInfoSingle(
        @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
        @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
        @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
        @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
        @ThriftField(value=5, name="facePos", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "matHasFace",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    boolean matHasFace(
        @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
        @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
        @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
        @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "matSearchFaces",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    List<FseResult> matSearchFaces(
        @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
        @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
        @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
        @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
        @ThriftField(value=5, name="facePos", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos,
        @ThriftField(value=6, name="similarty", requiredness=Requiredness.REQUIRED) final double similarty,
        @ThriftField(value=7, name="rows", requiredness=Requiredness.REQUIRED) final int rows
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "matWearMask",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    boolean matWearMask(
        @ThriftField(value=1, name="matType", requiredness=Requiredness.OPTIONAL) final MatType matType,
        @ThriftField(value=2, name="matData", requiredness=Requiredness.OPTIONAL) final byte [] matData,
        @ThriftField(value=3, name="width", requiredness=Requiredness.REQUIRED) final int width,
        @ThriftField(value=4, name="height", requiredness=Requiredness.REQUIRED) final int height,
        @ThriftField(value=5, name="faceInfo", requiredness=Requiredness.OPTIONAL) final CodeInfo faceInfo
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "sdkCapacity",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    Map<String, String> sdkCapacity() throws ServiceRuntimeException;

    @ThriftMethod(value = "searchFaces",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=NotFaceDetectedException.class, id=2),
                      @ThriftException(type=ServiceRuntimeException.class, id=3)
                  })
    List<FseResult> searchFaces(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="facePos", requiredness=Requiredness.OPTIONAL) final CodeInfo facePos,
        @ThriftField(value=3, name="similarty", requiredness=Requiredness.REQUIRED) final double similarty,
        @ThriftField(value=4, name="rows", requiredness=Requiredness.REQUIRED) final int rows
    ) throws ImageErrorException, NotFaceDetectedException, ServiceRuntimeException;

    @ThriftMethod(value = "searchFeatures",
                  exception = {
                      @ThriftException(type=ServiceRuntimeException.class, id=1)
                  })
    List<FseResult> searchFeatures(
        @ThriftField(value=1, name="feature", requiredness=Requiredness.OPTIONAL) final byte [] feature,
        @ThriftField(value=2, name="similarty", requiredness=Requiredness.REQUIRED) final double similarty,
        @ThriftField(value=3, name="rows", requiredness=Requiredness.REQUIRED) final int rows
    ) throws ServiceRuntimeException;

    @ThriftMethod(value = "wearMask",
                  exception = {
                      @ThriftException(type=ImageErrorException.class, id=1),
                      @ThriftException(type=ServiceRuntimeException.class, id=2)
                  })
    boolean wearMask(
        @ThriftField(value=1, name="imgData", requiredness=Requiredness.OPTIONAL) final byte [] imgData,
        @ThriftField(value=2, name="faceInfo", requiredness=Requiredness.OPTIONAL) final CodeInfo faceInfo
    ) throws ImageErrorException, ServiceRuntimeException;
}